<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>xhrlite.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_net_xhrlite.js.html">xhrlite.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2006 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview Wrapper class for handling XmlHttpRequests.
<a name="line17"></a> */
<a name="line18"></a>
<a name="line19"></a>
<a name="line20"></a>goog.provide(&#39;goog.net.XhrLite&#39;);
<a name="line21"></a>
<a name="line22"></a>goog.require(&#39;goog.net.XhrIo&#39;);
<a name="line23"></a>
<a name="line24"></a>
<a name="line25"></a>
<a name="line26"></a>/**
<a name="line27"></a> * Basic class for handling XmlHttpRequests.
<a name="line28"></a> * @deprecated Use goog.net.XhrIo instead.
<a name="line29"></a> * @constructor
<a name="line30"></a> */
<a name="line31"></a>goog.net.XhrLite = goog.net.XhrIo;
<a name="line32"></a>
<a name="line33"></a>// Statics are needed to avoid code removal.
<a name="line34"></a>
<a name="line35"></a>
<a name="line36"></a>/**
<a name="line37"></a> * Static send that creates a short lived instance of XhrIo to send the
<a name="line38"></a> * request.
<a name="line39"></a> * @see goog.net.XhrIo.cleanup
<a name="line40"></a> * @param {string} url Uri to make request too.
<a name="line41"></a> * @param {Function=} opt_callback Callback function for when request is
<a name="line42"></a> *     complete.
<a name="line43"></a> * @param {string=} opt_method Send method, default: GET.
<a name="line44"></a> * @param {string=} opt_content Post data.
<a name="line45"></a> * @param {Object|goog.structs.Map=} opt_headers Map of headers to add to the
<a name="line46"></a> *     request.
<a name="line47"></a> * @param {number=} opt_timeoutInterval Number of milliseconds after which an
<a name="line48"></a> *     incomplete request will be aborted; 0 means no timeout is set.
<a name="line49"></a> */
<a name="line50"></a>goog.net.XhrLite.send = goog.net.XhrIo.send;
<a name="line51"></a>
<a name="line52"></a>
<a name="line53"></a>/**
<a name="line54"></a> * Disposes all non-disposed instances of goog.net.XhrIo created by
<a name="line55"></a> * {@link goog.net.XhrIo.send}.
<a name="line56"></a> * {@link goog.net.XhrIo.send} cleans up the goog.net.XhrIo instance
<a name="line57"></a> * it creates when the request completes or fails.  However, if
<a name="line58"></a> * the request never completes, then the goog.net.XhrIo is not disposed.
<a name="line59"></a> * This can occur if the window is unloaded before the request completes.
<a name="line60"></a> * We could have {@link goog.net.XhrIo.send} return the goog.net.XhrIo
<a name="line61"></a> * it creates and make the client of {@link goog.net.XhrIo.send} be
<a name="line62"></a> * responsible for disposing it in this case.  However, this makes things
<a name="line63"></a> * significantly more complicated for the client, and the whole point
<a name="line64"></a> * of {@link goog.net.XhrIo.send} is that it&#39;s simple and easy to use.
<a name="line65"></a> * Clients of {@link goog.net.XhrIo.send} should call
<a name="line66"></a> * {@link goog.net.XhrIo.cleanup} when doing final
<a name="line67"></a> * cleanup on window unload.
<a name="line68"></a> */
<a name="line69"></a>goog.net.XhrLite.cleanup = goog.net.XhrIo.cleanup;
<a name="line70"></a>
<a name="line71"></a>
<a name="line72"></a>/**
<a name="line73"></a> * Installs exception protection for all entry point introduced by
<a name="line74"></a> * goog.net.XhrIo instances which are not protected by
<a name="line75"></a> * {@link goog.debug.ErrorHandler#protectWindowSetTimeout},
<a name="line76"></a> * {@link goog.debug.ErrorHandler#protectWindowSetInterval}, or
<a name="line77"></a> * {@link goog.events.protectBrowserEventEntryPoint}.
<a name="line78"></a> *
<a name="line79"></a> * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to
<a name="line80"></a> *     protect the entry point(s).
<a name="line81"></a> * @param {boolean=} opt_tracers Whether to install tracers around the entry
<a name="line82"></a> *     point.
<a name="line83"></a> */
<a name="line84"></a>goog.net.XhrLite.protectEntryPoints = goog.net.XhrIo.protectEntryPoints;
<a name="line85"></a>
<a name="line86"></a>
<a name="line87"></a>/**
<a name="line88"></a> * Disposes of the specified goog.net.XhrIo created by
<a name="line89"></a> * {@link goog.net.XhrIo.send} and removes it from
<a name="line90"></a> * {@link goog.net.XhrIo.pendingStaticSendInstances_}.
<a name="line91"></a> * @param {goog.net.XhrIo} XhrIo An XhrIo created by
<a name="line92"></a> *     {@link goog.net.XhrIo.send}.
<a name="line93"></a> * @private
<a name="line94"></a> */
<a name="line95"></a>goog.net.XhrLite.cleanupSend_ = goog.net.XhrIo.cleanupSend_;
<a name="line96"></a>
<a name="line97"></a>
<a name="line98"></a>/**
<a name="line99"></a> * The Content-Type HTTP header name
<a name="line100"></a> * @type {string}
<a name="line101"></a> */
<a name="line102"></a>goog.net.XhrLite.CONTENT_TYPE_HEADER = goog.net.XhrIo.CONTENT_TYPE_HEADER;
<a name="line103"></a>
<a name="line104"></a>
<a name="line105"></a>/**
<a name="line106"></a> * The Content-Type HTTP header value for a url-encoded form
<a name="line107"></a> * @type {string}
<a name="line108"></a> */
<a name="line109"></a>goog.net.XhrLite.FORM_CONTENT_TYPE = goog.net.XhrIo.FORM_CONTENT_TYPE;
<a name="line110"></a>
<a name="line111"></a>
<a name="line112"></a>/**
<a name="line113"></a> * All non-disposed instances of goog.net.XhrIo created
<a name="line114"></a> * by {@link goog.net.XhrIo.send} are in this Array.
<a name="line115"></a> * @see goog.net.XhrIo.cleanup
<a name="line116"></a> * @type {Array.&lt;goog.net.XhrIo&gt;}
<a name="line117"></a> * @private
<a name="line118"></a> */
<a name="line119"></a>goog.net.XhrLite.sendInstances_ = goog.net.XhrIo.sendInstances_;
</pre>


</body>
</html>
